<include file="public:header" />
<!--商品列表-->
<div class="pad_lr_10" >
    <form name="searchform" method="post" action="{:u('item_order/calendar_list')}">
    <table width="100%" cellspacing="0" class="search_form">
        <tbody>
            <tr>
                <td>
                <div class="explain_col">
                    订单编号 :
                    <input name="orderId" type="text" class="input-text" size="25" value="{$search.orderId}" />
                   地址 :
                    <input name="address" type="text" class="input-text" size="25" value="{$search.address}" />
					<if condition="$sm neq ''"><input type="hidden" name="sm" value="{$sm}" /></if>
                    送餐时间 :从
                    <input type="text" name="time_start" id="J_time_start" class="date" size="12" value="{$search.time_start}">
                    到
                    <input type="text" name="time_end" id="J_time_end" class="date" size="12" value="{$search.time_end}">
                    
                    <input type="hidden" name="act" id="act">
                    <input type="hidden" name="id[]" id="id">
                    <input type="submit" name="" class="btn" value="搜索" />
                    <!-- <input type="button" id="export" class="btn" value="导出到excel" /> -->
					
                </div>
                </td>
            </tr>
        </tbody>
    </table>
    
   
    <div class="J_tablelist table_list" data-acturi="{:U('item/ajax_edit')}">
    <table width="100%" cellspacing="0">
        <thead>
            <tr>
                <th width=25><input type="checkbox" id="checkall_t" class="J_checkall"></th>
                <th width="30"><span data-tdtype="order_by" data-field="id">ID</span></th>
                <th width="50"><span data-tdtype="order_by" data-field="orderId">订单编号</span></th>
                <th width="50"><span data-tdtype="order_by" data-field="orderId">联系人</span></th>
                <th width="70"><span data-tdtype="order_by" data-field="order_sumPrice">送餐日期</span></th>
                <th width="60">地址</span></th>
                <th width="120">联系电话</span></th>
                <th width="40">商品名称</th>
                <th width="80">{:L('operations_manage')}</th>
            </tr>
        </thead>
    	<tbody>
            <volist name="list" id="val" >
            <tr>
                <td align="center">
                    <php>if($val['status'] >-1){</php>
                    <input type="checkbox" name="id[]" class="J_checkitem" value="{$val.id}">
                    <php>}</php>
                </td>
                <td align="center">{$val.id}</td>
                <td align="center">{$val.orderId}</td>
                <td align="center">{$val.linkname}</td>
                <td align="center">{$val.date}</td>
                <td align="center">{$val.address}</td>
               
                <td align="center" >
                   {$val.mobile}
                </td> 
                <td align="center">

                    <php>
                        $order = M('item_order')->field('orderId')->where(array('id'=>$val['order_id']))->find();
                        if($order){
                            $item = M('order_detail')->where(array('orderId'=>$order['orderId']))->find();
                            echo $item['title'];                        }
                    </php>
                </td>
                <td align="center">
                <php>if($val['status'] == -1){</php>
                    <span class="red">已取消</span>
                <php>}else if($val['status'] == -2){</php>
                    <span class="red">已顺延</span>
                <php>}else{</php>
                    <a href="javascript:void(0)" onclick="return changeDate({$val['id']},'cancel')">取消</a>| <a href="javascript:void(0)" onclick="return changeDate({$val['id']},'switch')">顺延</a>
                <php>}</php>
                </td>
            </tr>
            </volist>
    	</tbody>
    </table>
    </div>
   
    <div class="btn_wrap_fixed">
      <label class="mr10"><input class='select_all' type="checkbox" name="id[]">全选</label>
        <input type="button" class="btn" id="cancel-btn" onclick="changeDate(0,'cancel')" value="取消"/>
        <input type="button" class="btn" onclick="changeDate(0,'switch')" value="顺延"/>
        <div id="pages">{$page}</div>
    </div>
    </form>
</div>
<include file="public:footer" />
<link rel="stylesheet" href="__STATIC__/js/calendar/calendar-blue.css"/>
<script src="__STATIC__/js/calendar/calendar.js"></script>
<script>
Calendar.setup({
	inputField : "J_time_start",
	ifFormat   : "%Y-%m-%d",
	showsTime  : false,
	timeFormat : "24"
});
Calendar.setup({
	inputField : "J_time_end",
	ifFormat   : "%Y-%m-%d",
	showsTime  : false,
	timeFormat : "24"
});


$("#export").click(function(){
    $("#act").attr("value","export");
    $("form").submit();
})

function changeDate(id,act){
    if(!confirm("您确定要执行此操作吗")){
        return false;
    }
    $('#id').val(id)
    $("#act").val(act)
    $("form").submit()
}

$(".select_all").click(function(){
    checked = $(this).attr('checked');
    if(checked == "checked"){
        $(".table_list input:checkbox").attr('checked',true)
    }else{
        $(".table_list input:checkbox").attr('checked',false)
    }
})
</script>
<!-- saved from url=(0048)http://www.gethx.com --></body>
</html>